//
//  ViewController.m
//  SkyTable
//
//  Created by mac  on 13-2-22.
//  Copyright (c) 2013年 Sky. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    skytable = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, 320,460) style:UITableViewStylePlain];
    [skytable setDelegate:self];
    [skytable setDataSource:self];
    array= [[NSMutableArray alloc]initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",nil];
    Title= [[NSMutableArray alloc]initWithObjects:@"点我啊",@"试试看",@"别这样嘛",@"讨厌啦",nil];
    [self.view addSubview:skytable];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 4;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
	static NSString *identity = @"cell";
    skyCell *cell = (skyCell *)[tableView dequeueReusableCellWithIdentifier:identity];
    if (cell == nil)
    {
        cell = [[[skyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identity]autorelease];
	}
    else
    {
		cell = [[[skyCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identity]autorelease];
	}
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.lblHead=[Title objectAtIndex:indexPath.row];
    cell.dataArray1=array;
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 140;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    //点击这个可以做，类似腾讯视频的扩展一样.
    NSLog(@"想要怎样你随意!");
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
